home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 5_5.lha / 5_5 / 5_5a1.c < prev    next >
Text File  |  1993-08-08  |  531b  |  28 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. ree *expandtree(istream &input)
  6.  
  7.    if (curr_tok.type == END)
  8. {
  9. f (debug)    cout << "expandtree() sees END\n";    // DELETE
  10. tree *ret = new tree;
  11. ret->type = NUMBER;
  12. ret->value = 0;
  13. return ret;
  14. }
  15.  
  16.    else
  17. return get_expr(input);
  18.  
  19.  
  20. xpr:: expr(char* s)
  21.  
  22.    istream input(strlen(s), s);
  23.    evaluated = 0;
  24.    get_token(input);
  25.    head = expandtree(input);
  26.    if (debug) head->print(0);    // DELETE
  27.  
  28.